﻿@model PagedList.IPagedList<Demo_test.Models.phantrang.Product>
@using PagedList.Mvc;
@{
    ViewBag.Title = "Index";
}

<h2>Phân Trang Hàng Hóa</h2>
<table cellpadding="1" cellspacing="1" border="1" class="table table-hover">
    <tr>
        <th>Name</th>
        <th>UnitBrief</th>
        <th>UnitPrice</th>
        <th>ProductDate</th>
        <th>CategoryId</th>
        <th>Image</th>
        
    </tr>
    @foreach(var a in Model)
    {
        <tr>
            <td>@a.Name</td>
            <td>@a.UnitBrief</td>
            <td>@a.UnitPrice</td>
            <td>@a.ProductDate</td>
            <td>@a.CategoryId</td>
            <td><img style="width: 100px;height: 40px;"  src="~/images/products/@a.Image" /></td>
           

        </tr>
    }
</table>
<br/><br /><br />
@Html.PagedListPager(Model , page => Url.Action("Index",
    new  { page, pageSize = Model.PageSize }))
Sản phẩm @Model.FirstItemOnPage Tới @Model.LastItemOnPage trong tổng số @Model.TotalItemCount Sản phẩm

<!--
Phân Trang 

   Install-Package PagedList
   Install-Package PagedList.MVC 
    
    
-->